package cn.cs.mapper;

import cn.cs.pojo.Agent;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface AgentMapper {

    public Agent getAgentById(@Param(value = "id") String id) throws Exception;

    public List<Agent> getAgentByNamePhone(@Param(value = "name") String name, @Param(value = "person") String person, @Param(value = "phone") String phone) throws Exception;

    public Agent getAgentByCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public List<Agent> getAgentByPCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public List<Agent> getAgentListByMap(Map<String, Object> param) throws Exception;

    public List<Agent> getAgentAllListByMap(Map<String, Object> param) throws Exception;

    public Integer getAgentCountByMap(Map<String, Object> param) throws Exception;

    public Integer insertAgent(Agent agent) throws Exception;

    public Integer updateAgent(Agent agent) throws Exception;

    public Long getMaxCode() throws Exception;

    public Integer deleteAgentById(@Param(value = "id") String id) throws Exception;

    public List<Map<String, Object>> getAgentAreaListById(@Param(value = "agentId") String agentId) throws Exception;

    public Integer insertAgentArea(Map<String, Object> param) throws Exception;

    public Integer deleteAgentAreaById(@Param(value = "id") String id) throws Exception;

    public List<Map<String, Object>> getProvinceList() throws Exception;

    public List<Map<String, Object>> getCityListByPid(@Param(value = "pId") String pId) throws Exception;

    public List<Map<String, Object>> getAreaListByPid(@Param(value = "pId") String pId, @Param(value = "list") List<Map<String, Object>> list) throws Exception;

    public List<Map<String, Object>> getAreasListByPid(@Param(value = "pId") String pId) throws Exception;

    public Long getUserNumberByAgentCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public Long getShopNumberByAgentCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public Long getAgentBNumberByAgentCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public Long getAgentNumberByAgentCode(@Param(value = "invitationCode") String invitationCode) throws Exception;

    public List<Map<String, Object>> getAreaProvince(@Param(value = "agentId") String agentId) throws Exception;

    public List<Map<String, Object>> getAreaCity(@Param(value = "agentId") String agentId, @Param(value = "pId") String pId) throws Exception;

    public List<Map<String, Object>> getAreaArea(@Param(value = "agentId") String agentId, @Param(value = "pId") String pId) throws Exception;

    public Map<String, Object> getAgentAreaById(@Param(value = "id") String id) throws Exception;

    public Map<String, Object> getAgentAreaByInvitationCode(@Param(value = "parent_invitation_code") String parent_invitation_code, @Param(value = "agent_area") String agent_area) throws Exception;

    public Integer updateAgentType(@Param(value = "parent_invitation_code") String parent_invitation_code, @Param(value = "agent_area") String agent_area, @Param(value = "invitation_code") String invitation_code, @Param(value = "id") String id) throws Exception;

    public String getAgentAreaTwoById(String id);

    public Map<String, Object> getAgentBYPhone(@Param(value = "phone") String phone) throws Exception;

    public String getAreaByProvinceId(String id);

    public Map<String, Object> getFirstByProvinceId(@Param(value = "id") String id) throws Exception;

    public Integer insertAgentAreaList(@Param(value = "list") List<Map<String, Object>> list);

    public List<Map<String, Object>> getAgentByArea(@Param(value="area") String area)throws Exception;

    public Map<String, String> getAgentABIdByCode(@Param(value="invitationCode") String invitationCode)throws Exception;

    public List<Agent> getAgentByOnlyArea(@Param(value = "area") String area)throws Exception;

    public int checkInvitationCode(String invitationCode);

    public List<Map<String, Object>> getAgentAreaAll();

    public List<Map<String, Object>> getAgentAreaByAgentId(@Param(value = "agentId") String agentId) throws Exception;


}
